<?php

/**
 * Midia form base class.
 *
 * @package    form
 * @subpackage midia
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseMidiaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_midia'   => new sfWidgetFormInputHidden(),
      'nm_midia'   => new sfWidgetFormInput(),
      'ds_midia'   => new sfWidgetFormInput(),
      'id_sistema' => new sfWidgetFormDoctrineChoice(array('model' => 'Sistema', 'add_empty' => true)),
      'user_id'    => new sfWidgetFormDoctrineChoice(array('model' => 'sfGuardUserProfile', 'add_empty' => true)),
      'created_at' => new sfWidgetFormDateTime(),
      'updated_at' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id_midia'   => new sfValidatorDoctrineChoice(array('model' => 'Midia', 'column' => 'id_midia', 'required' => false)),
      'nm_midia'   => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'ds_midia'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'id_sistema' => new sfValidatorDoctrineChoice(array('model' => 'Sistema', 'required' => false)),
      'user_id'    => new sfValidatorDoctrineChoice(array('model' => 'sfGuardUserProfile', 'required' => false)),
      'created_at' => new sfValidatorDateTime(array('required' => false)),
      'updated_at' => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('midia[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Midia';
  }

}
